Fix HAVE_LIBEXPAT test in autoconf for cross dev case.
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 29 Nov 2011 16:59:35 +0000 (16:59 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 29 Nov 2011 16:59:35 +0000 (16:59 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4126 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/configure
gpsbabel/configure.in

index ec4f9e1c194ddb1c97778cb775229c06f90d8a02..c0709eb97f9fa2b7862f9384aac12da145cc4df9 100755 (executable)
@@ -4518,31 +4518,16 @@ else
                        # libexpat installed via fink
                        EXPAT_LIB=/sw/lib/libexpat.a
                        LIBS="$LIBS -L/sw/lib"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBEXPAT 1
-_ACEOF
-
                fi
                if test -f /opt/local/lib/libexpat.a ; then
                        # libexpat installed via macports
                        EXPAT_LIB=/opt/local/lib/libexpat.a
                        LIBS="$LIBS -L/opt/local/lib"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBEXPAT 1
-_ACEOF
-
                fi
                if test -f /usr/local/lib/libexpat.a ; then
                        # libexpat installed from source
                        EXPAT_LIB=/usr/local/lib/libexpat.a
                        LIBS="$LIBS -L/usr/local/lib"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBEXPAT 1
-_ACEOF
-
                fi
                ;;
        *-gentoo-freebsd*)
@@ -4551,11 +4536,6 @@ _ACEOF
        *-*-freebsd*)
                if test -f /usr/local/lib/libexpat.a ; then
                        EXPAT_LIB=/usr/local/lib/libexpat.a
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBEXPAT 1
-_ACEOF
-
                fi
                ;;
        esac
@@ -4564,7 +4544,15 @@ _ACEOF
 fi
 
 
-if test "x${EXPAT_LIB}" = x; then
+if ! test "x${EXPAT_LIB}" = x; then
+  { echo "$as_me:$LINENO: result: $EXPAT_LIB" >&5
+echo "${ECHO_T}$EXPAT_LIB" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBEXPAT 1
+_ACEOF
+
+else
   { echo "$as_me:$LINENO: result: try to autodetect" >&5
 echo "${ECHO_T}try to autodetect" >&6; }
   { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
@@ -4638,9 +4626,6 @@ _ACEOF
 
 fi
 
-else
-  { echo "$as_me:$LINENO: result: $EXPAT_LIB" >&5
-echo "${ECHO_T}$EXPAT_LIB" >&6; }
 fi
 
 
index 74a7c3ab2010bc894e0170dc8a8350a36c928210..719f8dd6bcd006a840f9d4d475ebddf056bf668c 100644 (file)
@@ -303,19 +303,16 @@ AC_ARG_WITH(libexpat,
                        # libexpat installed via fink
                        EXPAT_LIB=/sw/lib/libexpat.a
                        LIBS="$LIBS -L/sw/lib"
-                         AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
                fi
                if test -f /opt/local/lib/libexpat.a ; then
                        # libexpat installed via macports
                        EXPAT_LIB=/opt/local/lib/libexpat.a
                        LIBS="$LIBS -L/opt/local/lib"
-                         AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
                fi
                if test -f /usr/local/lib/libexpat.a ; then
                        # libexpat installed from source
                        EXPAT_LIB=/usr/local/lib/libexpat.a
                        LIBS="$LIBS -L/usr/local/lib"
-                         AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
                fi                              
                ;;
        *-gentoo-freebsd*)
@@ -324,21 +321,21 @@ AC_ARG_WITH(libexpat,
        *-*-freebsd*)
                if test -f /usr/local/lib/libexpat.a ; then
                        EXPAT_LIB=/usr/local/lib/libexpat.a
-                         AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
                fi
                ;;
        esac
   ]
 )
 
-if test "x${EXPAT_LIB}" = x; then
+if ! test "x${EXPAT_LIB}" = x; then
+  AC_MSG_RESULT($EXPAT_LIB)
+  AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
+else
   AC_MSG_RESULT(try to autodetect)
   AC_CHECK_LIB([expat], [XML_ParserCreate], 
     AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
     EXPAT_LIB=-lexpat
   )
-else
-  AC_MSG_RESULT($EXPAT_LIB)
 fi
 AC_SUBST(EXPAT_LIB)